﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace HPKaraoke
{
    /// <summary>
    /// Interaction logic for MyMessageBox.xaml
    /// </summary>
    public partial class MyMessageBox : UserControl
    {

        public string Text 
        {
            get { return label1.Content.ToString(); }
            set { label1.Content = value; } 
        }

        public Window WindowParent { get; set; }

        public MyMessageBox()
        {
            InitializeComponent();
            this.Focus();
        }

        private void Image_MouseDown(object sender, MouseButtonEventArgs e)
        {
            this.Tag = 1;
            this.WindowParent.Close();
        }

        private void Image_ImageFailed(object sender, ExceptionRoutedEventArgs e)
        {
            this.Tag = 0;
        }

        private void UserControl_LostFocus(object sender, RoutedEventArgs e)
        {
            this.Focus();
        }

        private void Image_MouseDown_1(object sender, MouseButtonEventArgs e)
        {
            this.Tag = 0;
            Grid d = (Grid)WindowParent.FindName("mainGrid");
            d.Children.Remove(this);
            
        }
    }
}
